package org.csmzxy2334;

import java.util.Scanner;

public class 判断水仙花数 {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个三位数：");
        int s = scanner.nextInt();
        if (s >= 100 && s <= 999){
            int a = s / 100;
            int b = (s / 10) % 10;
            int c = s % 10;
            int x = (int)(Math.pow(a, 3) + Math.pow(b, 3) + Math.pow(c, 3));
            if (x == s){
                System.out.println(s + "是水仙花数");
            } else {
                 System.out.println(s + "不是水仙花数");
            }
        } else {
            System.out.println("你输入的不是一个三位数，请重新输入");
        }
        scanner.close();
    }
}
